package com.tbit.uqbike.service.business;

import com.tbit.uqbike.object.pojo.AccountAuth;
import com.tbit.uqbike.object.pojo.RideLogDetails;
import com.tbit.uqbike.object.pojo.dto.EditOrderDTO;
import com.tbit.uqbike.object.pojo.dto.FinishOrderDTO;
import com.tbit.uqbike.object.pojo.dto.RideLogDetailsDownloadDTO;
import com.tbit.uqbike.object.pojo.dto.RideLogDetailsQueryDTO;
import com.tbit.uqbike.object.pojo.vo.EfficientCardVO;
import com.tbit.uqbike.object.pojo.vo.RideLogDetailsSumVO;
import com.tbit.uqbike.object.pojo.vo.RideLogDetailsVO;
import com.tbit.uqbike.object.value.LoginInfo;
import com.tbit.common.entity.view.PageResult;
import com.tbit.common.entity.view.Result;

import java.io.File;

/**
 * @Author:BUGTian
 * @DATE: 2022/11/12
 */
public interface RideLogDetailsService {
    /**
     * 查询订单详情
     *
     * @param queryDTO
     * @return
     */
    PageResult<RideLogDetails> queryPage(RideLogDetailsQueryDTO queryDTO);

    /**
     * 骑行订单统计
     *
     * @param queryDTO
     * @return
     */
    RideLogDetailsSumVO sum(RideLogDetailsQueryDTO queryDTO);

    /**
     * 查询骑行记录
     *
     * @param login
     * @param phone
     * @param userCode
     * @param page
     * @param size
     * @return
     */
    PageResult<RideLogDetailsVO> queryCyclingRecord(LoginInfo login, String phone, String userCode, Integer page, Integer size);

    /**
     * 获取区域权限
     *
     * @param login
     * @return
     */
    AccountAuth getAccountAuth(LoginInfo login);

    /**
     * 人工结束订单
     *
     * @param login
     * @param finishOrderDTO
     * @return
     */
    Result finishOrder(LoginInfo login, FinishOrderDTO finishOrderDTO);

    /**
     * 人工修改订单金额
     *
     * @param login
     * @param editOrderDTO
     * @return
     */
    Result editOrder(LoginInfo login, EditOrderDTO editOrderDTO);

    String downloadRideLogDetail(RideLogDetailsDownloadDTO downloadDTO);

    public File downloadRideLogDetail(RideLogDetailsDownloadDTO downloadDTO, File tempFile);

    /**
     * 根据订单编号查询订单详情
     *
     * @param orderId
     * @return
     */
    RideLogDetailsVO queryByOrderId(String orderId);

    /**
     * 清除用户骑行欠款
     * @param login 登录信息
     * @param login 登录信息
     * @return
     */
    Result<String> clearArrears(LoginInfo login, Integer userId);

    /**
     * 获取用户生效的卡券
     * @param userId    用户id
     * @param accountId    区域id
     * @return  Result<EfficientCardVO>
     */
    Result<EfficientCardVO> getEfficientCard(Integer userId, Integer accountId);

    /**
     * 消费卡券
     * @param userId        用户id
     * @param accountId     区域id
     * @param rideCardId    骑行卡id
     * @param vipId         会员卡id
     * @param couponId      优惠券id
     * @return  String
     */
    String consumptionCardCoupon(Integer userId, Integer accountId, Integer rideCardId, Integer vipId, Integer couponId);
}
